from selenium import webdriver
from selenium.webdriver.common.by import By
import time

# 页面滚动
driver = webdriver.Edge()

url = "https://www.douyu.com/directory/all"

driver.get(url)
driver.maximize_window()
time.sleep(2)

# 使用js命令
js_str = "window.scrollTo(0,1000000)"
# 执行js命令
driver.execute_script(js_str)

# driver.implicitly_wait(5)
# driver.find_element(By.XPATH,"//*[text()='下一页']").click()

time.sleep(5)
driver.quit()